﻿@{
    ViewBag.Title = "供应商用户列表";
}

@model List<ApplicationUser>
@inject UserManager<ApplicationUser> _userManager;

<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-header">
                <div class="card-tools">
                    <div class="btn-group">
                        <a class="btn btn-default" asp-action="UserEdit" asp-route-Id=@null>新&nbsp;增</a>
                    </div>
                </div>
            </div>
            <div class="card-body table-responsive p-3">
                <table class="table table-hover text-nowrap table-bordered">
                    <thead class="thead-dark">
                        <tr>
                            <th>编码</th>
                            <th>角色名称</th>
                            <th>供应商编码</th>
                            <th>供应商名称</th>
                            <th>用户名</th>
                            <th>手机号</th>
                            <th>账户禁用</th>
                            <th>解锁时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr>
                                @*class="sr-only"*@
                                <td>@item.Id</td>
                                <td>@item.RoleName</td>
                                <td>@item.SupplierNo</td>
                                <td>@item.SupplierName</td>
                                <td>@item.UserName</td>
                                <td>@item.PhoneNumber</td>
                                <td>
                                    @_userManager.IsLockedOutAsync(item).Result
                                </td>
                                <td>@item.LockoutEnd</td>
                                <td>
                                    <a asp-action="UserEdit" asp-route-Id="@item.Id" class="btn btn-primary">编辑</a>
                                    <a asp-action="DeleteUser" asp-route-Id="@item.Id" class="btn btn-primary">删除</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
